#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <fstream>

/*
    请使用C/C++编程，g++版本为10.3.1，编译选项-O3
    有效提交文件为private_header.h和exec函数实现
    答案正确性检查读取output[idx].txt进行验证
    注意，输出文件名和标准答案文件名不同，没有_std后缀
*/

// 引用使用的额外头文件，需要提交
#include "private_header.h"

using namespace std;

struct task {
    int portion;
    int compute_time;
    int communication_time;
};

void read_tasks(struct task *tasks, int *N, int idx)
{
    string name;
    ifstream inf;

    name = "input" + to_string(idx) + ".txt";
    inf.open(name);
    inf >> *N;
    for (int i = 0; i < *N; i++) {
        inf >> tasks[i].portion;
        inf >> tasks[i].compute_time;
        inf >> tasks[i].communication_time;
    }
    inf.close();
}

void exec(const struct task *splitted_task, int N, int idx)
{
    /*
        完成第idx组测试的计算，输出结果到文件output[idx].txt
    */
}

#define MAX_TASK 100
#define MAX_TEST 20
int main()
{
    clock_t t1, t2;
    int N;
    struct task tasks[MAX_TASK];

    for (int i = 0; i < MAX_TEST; i++) {
        t1 = clock();
        read_tasks(tasks, &N, i);
        exec(tasks, N, i);
        t2 = clock();
        printf("idx: %d cost: %lf sec\n", i, (double)(t2 - t1) / CLOCKS_PER_SEC);
    }
    
    return 0;
}